#include <iostream>
#include <thread>
#include "log.h"
#include "perf_timer.h"

int main()
{
    SYS_LOG_MS(_INFO) << "Elapsed time: start";
    Base::Utils::PerfTimerS perfTimerS;
    std::this_thread::sleep_for(std::chrono::milliseconds(1500));
    double elapsed = perfTimerS.Elapsed();
    SYS_LOG_MS(_INFO) << "Elapsed time: " << elapsed << " s";

    Base::Utils::PerfTimerMs perfTimerMs;
    std::this_thread::sleep_for(std::chrono::milliseconds(500));
    elapsed = perfTimerMs.Elapsed();
    SYS_LOG_MS(_INFO) << "Elapsed time: " << elapsed << " ms";

    Base::Utils::PerfTimerUs perfTimerUs;
    std::this_thread::sleep_for(std::chrono::microseconds(300));
    elapsed = perfTimerUs.Elapsed();
    SYS_LOG_MS(_INFO) << "Elapsed time: " << elapsed << " us";

    Base::Utils::PerfTimerNs perfTimerNs;
    std::this_thread::sleep_for(std::chrono::nanoseconds(800));
    elapsed = perfTimerNs.Elapsed();
    SYS_LOG_MS(_INFO) << "Elapsed time: " << elapsed << " ns";
    return 0;
}
